package com.n5x.model.shopping;

import com.n5x.model.AbstractModel;
import com.n5x.model.goods.GoodsInfo;

import java.math.BigDecimal;

public class ShoppingOrderDetails extends AbstractModel {

    public ShoppingOrderDetails() {
    }

    public ShoppingOrderDetails(GoodsInfo goodsInfo, int qty) {
        this.name = goodsInfo.getName();
        this.thumbnail = goodsInfo.getPicture();
        this.price = goodsInfo.getPrice();
        this.preferentialPrice = goodsInfo.getPreferentialPrice();
        this.qty = qty;
        this.fkSourceId = goodsInfo.getId();
        this.codeId = goodsInfo.getCodeId();
    }

    /**
     * 关联订单
     */
    private String fkShoppingOrder;

    /**
     * 商品名称
     */
    private String name;

    /**
     * 缩略图
     */
    private String thumbnail;

    /**
     * 单价
     */
    private BigDecimal price = new BigDecimal(0);

    /**
     * 优惠金额
     */
    private BigDecimal preferentialPrice = new BigDecimal(0);
    ;

    /**
     * 购买数量
     */
    private Integer qty = 0;

    /**
     * 关联商品或关联礼品
     */
    private String fkSourceId;

    private String codeId;

    public String getFkShoppingOrder() {
        return fkShoppingOrder;
    }

    public void setFkShoppingOrder(String fkShoppingOrder) {
        this.fkShoppingOrder = fkShoppingOrder;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getThumbnail() {
        return thumbnail;
    }

    public void setThumbnail(String thumbnail) {
        this.thumbnail = thumbnail;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getPreferentialPrice() {
        return preferentialPrice;
    }

    public void setPreferentialPrice(BigDecimal preferentialPrice) {
        this.preferentialPrice = preferentialPrice;
    }

    public Integer getQty() {
        return qty;
    }

    public void setQty(Integer qty) {
        this.qty = qty;
    }

    public String getFkSourceId() {
        return fkSourceId;
    }

    public void setFkSourceId(String fkSourceId) {
        this.fkSourceId = fkSourceId;
    }

    public String getCodeId() {
        return codeId;
    }

    public void setCodeId(String codeId) {
        this.codeId = codeId;
    }
}